/**
 * 项目名：化工企业安全生产信息化管理平台
 * 日期：    2020-06-28 02:01:44
 * Copyright (c) 2015- -版权所有
 */

package com.joysuch.wwyt.audit.service;

import com.joysuch.wwyt.audit.bean.AuditLogRecordDetailBean;
import com.joysuch.wwyt.audit.bean.AuditLogRecordEditBean;
import com.joysuch.wwyt.audit.bean.AuditLogRecordListBean;
import com.joysuch.wwyt.audit.bean.AuditLogRecordListBean.SearchAuditLogRecord;
import com.joysuch.wwyt.audit.entity.AuditLogRecord;
import com.joysuch.wwyt.core.common.ajax.ResultBean;
import com.joysuch.wwyt.core.exception.BusinessRestrictionsException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.Date;

public interface AuditLogRecordService {

    public AuditLogRecord add(AuditLogRecordEditBean entity);

    void update(AuditLogRecordEditBean entity);

    Page<AuditLogRecordListBean> findByPage(Pageable page, SearchAuditLogRecord condition);

    ResultBean findByPageHis(Pageable page, AuditLogRecordListBean.SearchAuditLogHisRecord condition);

    void delete(Long id) throws BusinessRestrictionsException;

    AuditLogRecordDetailBean getById(Long id);

    AuditLogRecord findById(Long id);

    /**
     * 添加审计日志
     *
     * @param module
     *            模块
     * @param operationName
     *            操作名称
     * @param result
     *            结果。0表示成功，其他值表示失败
     * @param operationObjectType
     *            操作对象类型
     * @param operationObjectValue
     *            操作对象值，一般传递ID
     * @param description
     *            操作描述
     */
    void addAuditLog(String module, String operationName, int result, Class opeartionObjectType,
                     String operationObjectValue, String description);

    void autoMoveAuditLog();

    void autoMoveAuditLogOnce();

    void handleMoveAuditLog(Date endTime);

}
